package com.atguigu.lease.common.springmvc;


import com.atguigu.lease.common.exceptions.LeaseException;
import com.atguigu.lease.common.result.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.multipart.MaxUploadSizeExceededException;


@RestControllerAdvice
public class GlobalExceptionHandlers {

    //定义各种异常处理的方法
    @ExceptionHandler(MaxUploadSizeExceededException.class)
    public Result exception(MaxUploadSizeExceededException e) {
        e.printStackTrace(); //打印异常信息
        System.out.println("e = " + e);
        return Result.fail();
    }



}
